Avorion Script API Documentation

Button [Client] [Client] : UIElement

This object is only available on the client.

function Button(int index)

Returns

A new instance of Button

property bool active
Set/Get whether a button is active. Active buttons can be pressed.
property int alignment[write-only]
property bool bold
Set whether the button text is bold or not
property string caption
Set the caption of a button
property Color captionColor[write-only]
Set the caption color of a button
property int fontType[write-only]
property bool hasFrame[write-only]
Set whether the button's frame is drawn or only its caption or icon
property string icon
Set the icon of a button
property Color iconColor[write-only]
Set the icon color of a button
property int maxTextSize
Get/Set the maximum text size in pixels of the button. Setting this property enables automatic scaling of text to fit the button. Might lead to too small texts when used with large captions, especially with different translations.
property string onPressedFunction
Set the function that is invoked when pressing the button. Called function signature is 'function MyFunctionName(button)'
property string overlayIcon[write-only]
property int overlayIconAlignment[write-only]
sets where the overlay icon should be positioned on the button. Use numbers 1 - 9, where each number refers to the location of the corresponding button on a cellphone dial (1 = top left, 2 = top, 5 = center, 9 = bottom right etc)
property Color overlayIconColor[write-only]
property int overlayIconPadding[write-only]
property float overlayIconSizeFactor[write-only]
property int textSize
Get/Set the text size in pixels of the button. Setting this property will disable automatic scaling of text and may lead to clipping errors with larger texts. Especially with different translations.
property bool uppercase
property vec2 center
property float height
property int index[read-only]
property int layer
property vec2 localCenter[read-only]
property vec2 localPosition[read-only]
property Rect localRect[read-only]
property vec2 lower
property bool mouseOver[read-only]
property vec2 position
property Rect rect
property vec2 size
property var tooltip
property int tooltipWidth[write-only]
property vec2 upper
property bool visible
property float width

function var hide()

Inherited from UIElement

Returns

nothing

function bool isMouseOverAndUnobscured()

Inherited from UIElement

function var show()

Inherited from UIElement

Returns

nothing

Overview
Home Functions Search
Search:

This is the official documentation for the scripting API of Avorion. This documentation is automatically generated and not necessarily complete. Depending on the context in which functions exist, some documentation such as descriptions, return values or variable names or types may be missing.

Work in Progress. Documentation of Avorion Version: 2.5.7 c8e4beec84f7